package structural.strategy;

import structural.strategy.interfaces.MonkeyFood;

/**
 * @Author douhy
 * @description 测试场景类
 * @date 22/03/08
 */
public class Client {
    public static void main(String[] args) {
        // 模板方法模式
        Zoo zoo = new Zoo(new Peach());
        zoo.lunch();
        zoo = new Zoo(new Apple());
        zoo.lunch();
        zoo = new Zoo(new Banana());
        zoo.lunch();


        // 访问者模式
        zoo = new Zoo(new MonkeyFood() {
            @Override
            public void eat() {
                System.out.println("今天交给写代码的你告诉我吃啥");
            }
        });
        zoo.lunch();
    }
}
